﻿<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" autoFlush="true"%>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display"%>
<%@ taglib uri="/WEB-INF/qautil.tld" prefix="qautil"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<script type="text/javascript" src="<%=request.getContextPath()%>/qa/js/Calendar.js"></script>
<html:form method="post" action="/msg">
	<input type="hidden" name="action" value="search" />
	发件人：<html:text property="fromUserLoginName" size="15"/>
	收件人：<html:text property="toUserLoginName" size="15"/>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	发送日期 从：
	<html:text property="fromDate" size="15" onchange="javascript:gChangeDate(this,0);" onblur="javascript:gChangeDate(this,0);" onclick='showCalendar(fromDate,0)'/>
	到：
	<html:text property="toDate" size="15" onchange="javascript:gChangeDate(this,0);" onblur="javascript:gChangeDate(this,0);" onclick='showCalendar(toDate,0)'/>
	<input type="submit" value="查询" />
</html:form>
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td>   
            <span class="title1">消息检索</span>
        </td>
        <td align="center">
            &nbsp;
        </td>
    </tr>
</table>
<display:table name="messageList" class="qlist" id="message" cellpadding="0" cellspacing="0">
    <display:column title="发件人">
        <c:if test="${not empty message.mrIaskUserByFromUserId}">
        <c:url value="/user.mrqa?action=viewuserbyother" var="userLink">
            <c:param name="id" value="${message.mrIaskUserByFromUserId.id}"/>
        </c:url>
        <a href="<c:out value="${userLink}"/>"><c:out value="${message.mrIaskUserByFromUserId.loginName}"/></a>
        </c:if>
        <c:if test="${empty message.mrIaskUserByFromUserId}">
            <c:out value="${message.fromUserLoginName}"/>
        </c:if>
    </display:column>
    <display:column title="收件人">
        <c:if test="${not empty message.mrIaskUserByFromUserId}">
        <c:url value="/user.mrqa?action=viewuserbyother" var="userLink">
            <c:param name="id" value="${message.mrIaskUserByToUserId.id}"/>
        </c:url>
        <a href="<c:out value="${userLink}"/>"><c:out value="${message.mrIaskUserByToUserId.loginName}"/></a>
        </c:if>
        <c:if test="${empty message.mrIaskUserByFromUserId}">
            <c:out value="${message.fromUserLoginName}"/>
        </c:if>
    </display:column>
    <display:column title="主题">   
      <span title="<c:out value="${message.title}"/>"><c:out value="${fn:substring(message.title,0,15)}"/><c:if test="${fn:length(message.title)>20}">.....</c:if>
    	</span> 
    </display:column>
    <display:column title="内容">
    	<span title="<c:out value="${message.content}"/>"><c:out value="${fn:substring(message.content,0,20)}"/><c:if test="${fn:length(message.content)>20}">.....</c:if>
    	</span>
    </display:column>
    <display:column title="发送日期">
        <fmt:formatDate value="${message.postDate}" type="both" pattern="yyyy-MM-dd HH:mm"/>
    </display:column>
</display:table>
<qautil:page action="/msg.mrqa"/>
